package cra.clima.samples.gsrad;

import java.awt.BorderLayout;
import java.util.Enumeration;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;

import net.sf.xqore.math.XQMath;
import cra.clima.core.interfaces.gsrad.IAGSRadStrategy;
import cra.clima.core.interfaces.gsrad.IRadData;
import cra.clima.gsrad.BristowCampbellParameters;
import cra.clima.gsrad.DonatelliBellocchiParameters;
import cra.clima.gsrad.GSRBristowCampbellStrategy;
import cra.clima.gsrad.GSRDonatelliBellocchiStrategy;
import cra.clima.gsrad.GSRRichardsonStrategy;
import cra.clima.gsrad.GSRSupitVanKappelStrategy;
import cra.clima.gsrad.GSRadContext;
import cra.clima.gsrad.HBDRLiuJordanHourlyStrategy;
import cra.clima.gsrad.HGSRGlobalSolarRadiationHourlyStrategy;
import cra.clima.gsrad.LiuJordanHourlyParameters;
import cra.clima.gsrad.MethodEnum;
import cra.clima.gsrad.RadData;
import cra.clima.gsrad.RichardsonParameters;
import cra.clima.gsrad.StateEnum;
import cra.clima.gsrad.SupitVanKappelParameters;

public class FrontEnd extends JFrame {

	private static final long serialVersionUID = 1L;

	private JPanel jContentPane = null;

	private JTabbedPane jTabbedPane = null;

	private JPanel jPDaily = null;

	private JTextField jTFSolarRadiation = null;

	private JLabel jLabel = null;

	private JTextField jTFClearSkyTrans = null;

	private JLabel jLabel1 = null;

	private javax.swing.ButtonGroup methodGSR = new javax.swing.ButtonGroup();

	private JRadioButton jRBBristowCampbell = null;

	private JRadioButton jRBDonatelliBellocchi = null;

	private JRadioButton jRBSupitVanKappel = null;

	private JRadioButton jRBRichardson = null;

	private JPanel jPBC = null;

	private JPanel jPDB = null;

	private JTextField jTFBCb = null;

	private JLabel jLabel2 = null;

	private JTextField jTFDBb = null;

	private JLabel jLabel3 = null;

	private JLabel jLabel4 = null;

	private JPanel jPSupit = null;

	private JPanel jPRich = null;

	private JTextField jTFSupitCloudCover = null;

	private JTextField jTFSupitCCCoeff = null;

	private JLabel jLabel5 = null;

	private JLabel jLabel6 = null;

	private JLabel jLabel7 = null;

	private JLabel jLabel8 = null;

	private JTextField jTFRichMR = null;

	private JTextField jTFRichMStdDevRad = null;

	private JButton jBDaily = null;

	private JLabel jLDailyGenGlobSolRad = null;

	private JLabel jLabel10 = null;

	private JTextField jTFBCSlope = null;

	private JLabel jLabel11 = null;

	private JTextField jTFBCAitTMonth = null;

	private JTextField jTFBCAitTDay = null;

	private JLabel jLabel12 = null;

	private JLabel jLabel13 = null;

	private JPanel jPGSR = null;

	private JLabel jLabel14 = null;

	private JLabel jLabel15 = null;

	private JTextField jTFGSRDay = null;

	private JLabel jLabel16 = null;

	private JTextField jTFGSRLatitude = null;

	private JLabel jLabel17 = null;

	private JLabel jLabel18 = null;

	private JTextField jTFGSRGSR = null;

	private JLabel jLabel19 = null;

	private JLabel jLabel20 = null;

	private JButton jButton = null;

	private JTextField jTFDBC1 = null;

	private JPanel jPBRDC = null;

	private JLabel jLabel9 = null;

	private JTextField jTFElevation = null;

	private JLabel jLabel21 = null;

	private JTextField jTFAlbedo = null;

	private JLabel jLabel22 = null;

	private JTextField jTFLTF = null;

	private JLabel jLabel23 = null;

	private JButton jBLiu = null;

	private JScrollPane jSPGSR = null;

	private JTable jTGSR = null;

	private DefaultTableModel TModelGSR = null; // @jve:decl-index=0:visual-constraint=""

	private JScrollPane jSPBRDC = null;

	private JTable jTBRDC = null;

	private DefaultTableModel ModelBRDC = null; // @jve:decl-index=0:visual-constraint=""

	private JTextField jTFClearSkyTransLJ = null;

	private JLabel jLabel24 = null;

	private JTextField jTFDay = null;

	private JLabel jLabel26 = null;

	// This method returns the selected radio button in a button group
	public static javax.swing.JRadioButton getSelection(
			javax.swing.ButtonGroup group) {
		for (Enumeration e = group.getElements(); e.hasMoreElements();) {
			javax.swing.JRadioButton b = (javax.swing.JRadioButton) e
					.nextElement();
			if (b.getModel() == group.getSelection()) {
				return b;
			}
		}
		return null;
	}

	/**
	 * This method initializes jTabbedPane
	 * 
	 * @return javax.swing.JTabbedPane
	 */
	private JTabbedPane getJTabbedPane() {
		if (jTabbedPane == null) {
			jTabbedPane = new JTabbedPane();
			jTabbedPane.setFont(new java.awt.Font("Dialog",
					java.awt.Font.PLAIN, 12));
			jTabbedPane.addTab("Daily Generation", null, getJPDaily(), null);
			jTabbedPane.addTab("Hourly generation: global solar radiation",
					null, getJPGSR(), null);
			jTabbedPane.addTab(
					"hourly generation: beam reflected and diffuse components",
					null, getJPBRDC(), null);
		}
		return jTabbedPane;
	}

	/**
	 * This method initializes jPanelDaily
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPDaily() {
		if (jPDaily == null) {
			jLabel10 = new JLabel();
			jLabel10.setBounds(new java.awt.Rectangle(190, 290, 201, 21));
			jLabel10.setText("generated global solar radiation");
			jLDailyGenGlobSolRad = new JLabel();
			jLDailyGenGlobSolRad.setBounds(new java.awt.Rectangle(140, 290, 41,
					21));
			jLDailyGenGlobSolRad.setText("0.00");
			jLabel1 = new JLabel();
			jLabel1.setBounds(new java.awt.Rectangle(410, 10, 151, 21));
			jLabel1
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jLabel1.setText("clear sky transmissivity");
			jLabel = new JLabel();
			jLabel.setBounds(new java.awt.Rectangle(100, 10, 181, 21));
			jLabel
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jLabel.setText("extraterrestial solar radiation");
			jPDaily = new JPanel();
			jPDaily.setLayout(null);
			jPDaily
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jPDaily.add(getJTFSolarRadiation(), null);
			jPDaily.add(jLabel, null);
			jPDaily.add(getJTFClearSkyTrans(), null);
			jPDaily.add(jLabel1, null);
			jPDaily.add(getJRBBristowCampbell(), null);
			jPDaily.add(getJRBDonatelliBellocchi(), null);
			jPDaily.add(getJRBSupitVanKappel(), null);
			jPDaily.add(getJRBRichardson(), null);
			jPDaily.add(getJPBC(), null);
			jPDaily.add(getJPDB(), null);
			jPDaily.add(getJPSupit(), null);
			jPDaily.add(getJPRich(), null);
			jPDaily.add(getJBDaily(), null);
			jPDaily.add(jLDailyGenGlobSolRad, null);
			jPDaily.add(jLabel10, null);
		}
		return jPDaily;
	}

	/**
	 * This method initializes jTFSolarRadiation
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFSolarRadiation() {
		if (jTFSolarRadiation == null) {
			jTFSolarRadiation = new JTextField();
			jTFSolarRadiation.setBounds(new java.awt.Rectangle(10, 10, 71, 21));
			jTFSolarRadiation.setText("30");
		}
		return jTFSolarRadiation;
	}

	/**
	 * This method initializes jTFClearSkyTrans
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFClearSkyTrans() {
		if (jTFClearSkyTrans == null) {
			jTFClearSkyTrans = new JTextField();
			jTFClearSkyTrans.setBounds(new java.awt.Rectangle(310, 10, 81, 21));
			jTFClearSkyTrans.setText("0.75");
		}
		return jTFClearSkyTrans;
	}

	/**
	 * This method initializes jRBBristowCampbell
	 * 
	 * @return javax.swing.JRadioButton
	 */
	private JRadioButton getJRBBristowCampbell() {
		if (jRBBristowCampbell == null) {
			jRBBristowCampbell = new JRadioButton();
			jRBBristowCampbell
					.setBounds(new java.awt.Rectangle(10, 60, 129, 21));
			jRBBristowCampbell.setSelected(true);
			jRBBristowCampbell.setFont(new java.awt.Font("Dialog",
					java.awt.Font.PLAIN, 12));
			jRBBristowCampbell.setText("Bristow Campbell");
			jRBBristowCampbell
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							// TODO BC
							jPBC.setVisible(true);
							jPDB.setVisible(false);
							jPSupit.setVisible(false);
							jPRich.setVisible(false);
							jTFSolarRadiation.setEditable(true);
							jTFClearSkyTrans.setEditable(true);
						}
					});
		}
		return jRBBristowCampbell;
	}

	/**
	 * This method initializes jRBDonatelliBellocchi
	 * 
	 * @return javax.swing.JRadioButton
	 */
	private JRadioButton getJRBDonatelliBellocchi() {
		if (jRBDonatelliBellocchi == null) {
			jRBDonatelliBellocchi = new JRadioButton();
			jRBDonatelliBellocchi.setBounds(new java.awt.Rectangle(200, 60,
					131, 21));
			jRBDonatelliBellocchi.setFont(new java.awt.Font("Dialog",
					java.awt.Font.PLAIN, 12));
			jRBDonatelliBellocchi.setText("Donatelli Bellocchi");
			jRBDonatelliBellocchi
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							// TODO DB
							jPBC.setVisible(false);
							jPDB.setVisible(true);
							jPSupit.setVisible(false);
							jPRich.setVisible(false);
							jTFSolarRadiation.setEditable(true);
							jTFClearSkyTrans.setEditable(true);
						}
					});
		}
		return jRBDonatelliBellocchi;
	}

	/**
	 * This method initializes jRBSupitVanKappel
	 * 
	 * @return javax.swing.JRadioButton
	 */
	private JRadioButton getJRBSupitVanKappel() {
		if (jRBSupitVanKappel == null) {
			jRBSupitVanKappel = new JRadioButton();
			jRBSupitVanKappel
					.setBounds(new java.awt.Rectangle(340, 60, 131, 21));
			jRBSupitVanKappel.setFont(new java.awt.Font("Dialog",
					java.awt.Font.PLAIN, 12));
			jRBSupitVanKappel.setText("Supit Van Kappel");
			jRBSupitVanKappel
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							// TODO Supit
							jPBC.setVisible(false);
							jPDB.setVisible(false);
							jPSupit.setVisible(true);
							jPRich.setVisible(false);
							jTFSolarRadiation.setEditable(true);
							jTFClearSkyTrans.setEditable(false);
						}
					});
		}
		return jRBSupitVanKappel;
	}

	/**
	 * This method initializes jRBRichardson
	 * 
	 * @return javax.swing.JRadioButton
	 */
	private JRadioButton getJRBRichardson() {
		if (jRBRichardson == null) {
			jRBRichardson = new JRadioButton();
			jRBRichardson.setBounds(new java.awt.Rectangle(540, 60, 101, 21));
			jRBRichardson.setFont(new java.awt.Font("Dialog",
					java.awt.Font.PLAIN, 12));
			jRBRichardson.setText("Richardson");
			jRBRichardson
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							// TODO Rich
							jPBC.setVisible(false);
							jPDB.setVisible(false);
							jPSupit.setVisible(false);
							jPRich.setVisible(true);
							jTFSolarRadiation.setEditable(false);
							jTFClearSkyTrans.setEditable(false);
						}
					});
		}
		return jRBRichardson;
	}

	/**
	 * This method initializes jPBC
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPBC() {
		if (jPBC == null) {
			jLabel13 = new JLabel();
			jLabel13.setBounds(new java.awt.Rectangle(60, 100, 111, 21));
			jLabel13.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel13.setText("Ait T Monthly Range");
			jLabel12 = new JLabel();
			jLabel12.setBounds(new java.awt.Rectangle(60, 70, 111, 21));
			jLabel12.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel12.setText("Ait T Daily Range");
			jLabel11 = new JLabel();
			jLabel11.setBounds(new java.awt.Rectangle(60, 40, 111, 21));
			jLabel11.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel11.setText("Slope Factor");
			jLabel2 = new JLabel();
			jLabel2.setBounds(new java.awt.Rectangle(60, 10, 41, 21));
			jLabel2
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jLabel2.setText("b");
			jPBC = new JPanel();
			jPBC.setLayout(null);
			jPBC.setBounds(new java.awt.Rectangle(10, 90, 181, 181));
			jPBC.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
					"", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
					javax.swing.border.TitledBorder.DEFAULT_POSITION, null,
					null));
			jPBC.setVisible(true);
			jPBC.add(getJTFBCb(), null);
			jPBC.add(jLabel2, null);
			jPBC.add(getJTFBCSlope(), null);
			jPBC.add(jLabel11, null);
			jPBC.add(getJTFBCAitTMonth(), null);
			jPBC.add(getJTFBCAitTDay(), null);
			jPBC.add(jLabel12, null);
			jPBC.add(jLabel13, null);
			methodGSR.add(jRBBristowCampbell);
			methodGSR.add(jRBDonatelliBellocchi);
			methodGSR.add(jRBSupitVanKappel);
			methodGSR.add(jRBRichardson);
		}
		return jPBC;
	}

	/**
	 * This method initializes jPDB
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPDB() {
		if (jPDB == null) {
			jLabel4 = new JLabel();
			jLabel4.setBounds(new java.awt.Rectangle(60, 40, 31, 21));
			jLabel4
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jLabel4.setText("C1");
			jLabel3 = new JLabel();
			jLabel3.setBounds(new java.awt.Rectangle(60, 10, 31, 21));
			jLabel3
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jLabel3.setText("b");
			jPDB = new JPanel();
			jPDB.setLayout(null);
			jPDB.setBounds(new java.awt.Rectangle(200, 90, 131, 181));
			jPDB.setBorder(javax.swing.BorderFactory.createLineBorder(
					java.awt.Color.gray, 1));
			jPDB.setVisible(false);
			jPDB.add(getJTFDBb(), null);
			jPDB.add(jLabel3, null);
			jPDB.add(jLabel4, null);
			jPDB.add(getJTFDBC1(), null);
		}
		return jPDB;
	}

	/**
	 * This method initializes jTFB
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFBCb() {
		if (jTFBCb == null) {
			jTFBCb = new JTextField();
			jTFBCb.setBounds(new java.awt.Rectangle(10, 10, 41, 21));
			jTFBCb.setText("0.12");
		}
		return jTFBCb;
	}

	/**
	 * This method initializes jTFDBb
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFDBb() {
		if (jTFDBb == null) {
			jTFDBb = new JTextField();
			jTFDBb.setBounds(new java.awt.Rectangle(10, 10, 41, 21));
			jTFDBb.setText("0.35");
		}
		return jTFDBb;
	}

	/**
	 * This method initializes jPSupit
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPSupit() {
		if (jPSupit == null) {
			jLabel6 = new JLabel();
			jLabel6.setBounds(new java.awt.Rectangle(60, 40, 131, 21));
			jLabel6
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jLabel6.setText("cloud cover coefficient");
			jLabel5 = new JLabel();
			jLabel5.setBounds(new java.awt.Rectangle(60, 10, 101, 21));
			jLabel5
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jLabel5.setText("cloud cover");
			jPSupit = new JPanel();
			jPSupit.setLayout(null);
			jPSupit.setBounds(new java.awt.Rectangle(340, 90, 191, 181));
			jPSupit.setBorder(javax.swing.BorderFactory.createLineBorder(
					java.awt.Color.gray, 1));
			jPSupit.setVisible(false);
			jPSupit.add(getJTFSupitCloudCover(), null);
			jPSupit.add(getJTFSupitCCCoeff(), null);
			jPSupit.add(jLabel5, null);
			jPSupit.add(jLabel6, null);
		}
		return jPSupit;
	}

	/**
	 * This method initializes jPRich
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPRich() {
		if (jPRich == null) {
			jLabel8 = new JLabel();
			jLabel8.setBounds(new java.awt.Rectangle(60, 40, 201, 21));
			jLabel8
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jLabel8.setText("monthly standard deviation radiation");
			jLabel7 = new JLabel();
			jLabel7.setBounds(new java.awt.Rectangle(60, 10, 111, 21));
			jLabel7
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jLabel7.setText("monthly radiation");
			jPRich = new JPanel();
			jPRich.setLayout(null);
			jPRich.setBounds(new java.awt.Rectangle(540, 90, 271, 181));
			jPRich.setBorder(javax.swing.BorderFactory.createLineBorder(
					java.awt.Color.gray, 1));
			jPRich.setVisible(false);
			jPRich.add(jLabel7, null);
			jPRich.add(jLabel8, null);
			jPRich.add(getJTFRichMR(), null);
			jPRich.add(getJTFRichMStdDevRad(), null);
		}
		return jPRich;
	}

	/**
	 * This method initializes jTFSupitCloudCover
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFSupitCloudCover() {
		if (jTFSupitCloudCover == null) {
			jTFSupitCloudCover = new JTextField();
			jTFSupitCloudCover
					.setBounds(new java.awt.Rectangle(10, 10, 41, 21));
			jTFSupitCloudCover.setText("3");
		}
		return jTFSupitCloudCover;
	}

	/**
	 * This method initializes jTFSupitCCCoeff
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFSupitCCCoeff() {
		if (jTFSupitCCCoeff == null) {
			jTFSupitCCCoeff = new JTextField();
			jTFSupitCCCoeff.setBounds(new java.awt.Rectangle(10, 40, 41, 21));
			jTFSupitCCCoeff.setText("0.3");
		}
		return jTFSupitCCCoeff;
	}

	/**
	 * This method initializes jTextField
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFRichMR() {
		if (jTFRichMR == null) {
			jTFRichMR = new JTextField();
			jTFRichMR.setBounds(new java.awt.Rectangle(10, 10, 41, 21));
			jTFRichMR.setText("25");
		}
		return jTFRichMR;
	}

	/**
	 * This method initializes jTFRichMStdDevRad
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFRichMStdDevRad() {
		if (jTFRichMStdDevRad == null) {
			jTFRichMStdDevRad = new JTextField();
			jTFRichMStdDevRad.setBounds(new java.awt.Rectangle(10, 40, 41, 21));
			jTFRichMStdDevRad.setText("5");
		}
		return jTFRichMStdDevRad;
	}

	/**
	 * This method initializes jBDaily
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJBDaily() {
		if (jBDaily == null) {
			jBDaily = new JButton();
			jBDaily.setBounds(new java.awt.Rectangle(10, 280, 101, 41));
			jBDaily
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jBDaily.setText("generate");
			jBDaily.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					// TODO Daily Generation
					String buttonName = getSelection(methodGSR).getText();

					try {
						if (buttonName.equals("Bristow Campbell")) {
							GSRBristowCampbellStrategy algo = new GSRBristowCampbellStrategy();

							RadData rd = new RadData();
							BristowCampbellParameters bcParams = new BristowCampbellParameters();
							bcParams.setB(Double.parseDouble(jTFBCb.getText()));
							rd.setClearSkyTransmissivity(Double
									.parseDouble(jTFClearSkyTrans.getText()));
							rd.setExtraTerrestrialRadiation(Double
									.parseDouble(jTFSolarRadiation.getText()));
							rd.setSlopeAspectFactor(Double
									.parseDouble(jTFBCSlope.getText()));
							rd.setAirTemperatureDailyRange(Double
									.parseDouble(jTFBCAitTDay.getText()));
							rd.setAirTemperatureMonthlyRange(Double
									.parseDouble(jTFBCAitTMonth.getText()));
							algo.setParameters(bcParams);
							GSRadContext gsr = new GSRadContext(
									(IAGSRadStrategy) algo);
							gsr.evaluate(rd);
							jLDailyGenGlobSolRad.setText(Double.toString(XQMath
									.round(rd.getGlobalSolarRadiation(), 2)));
						} else if (buttonName.equals("Donatelli Bellocchi")) {
							GSRDonatelliBellocchiStrategy sa = new GSRDonatelliBellocchiStrategy();
							RadData rd = new RadData();
							DonatelliBellocchiParameters dbParams = new DonatelliBellocchiParameters();
							dbParams.setB(Double.parseDouble(jTFDBb.getText()));
							dbParams.setC1(Double
									.parseDouble(jTFDBC1.getText()));
							dbParams.setReverse(false);
							rd.setClearSkyTransmissivity(Double
									.parseDouble(jTFClearSkyTrans.getText()));
							rd.setExtraTerrestrialRadiation(Double
									.parseDouble(jTFSolarRadiation.getText()));
							rd.setSlopeAspectFactor(1);
							rd.setAirTemperatureDailyRange(10);
							rd.setAirTemperatureWeeklyRange(9);
							sa.setParameters(dbParams);
							GSRadContext i = new GSRadContext(
									(IAGSRadStrategy) sa);
							i.evaluate(rd);
							jLDailyGenGlobSolRad.setText(Double.toString(XQMath
									.round(rd.getGlobalSolarRadiation(), 2)));
						} else if (buttonName.equals("Supit Van Kappel")) {
							IRadData rd = new RadData();
							SupitVanKappelParameters svkParams = new SupitVanKappelParameters();

							rd.setAirTemperatureDailyRange(10);
							rd.setExtraTerrestrialRadiation(Double
									.parseDouble(jTFSolarRadiation.getText()));
							rd.setSlopeAspectFactor(1);

							svkParams.setCloudCover(Integer
									.parseInt(jTFSupitCloudCover.getText()));
							svkParams.setAdjustmentFactor(2);
							svkParams.setCloudCoverCoefficent(Double
									.parseDouble(jTFSupitCCCoeff.getText()));
							svkParams.setTemperatureRangeCoefficent(0.1);

							GSRSupitVanKappelStrategy algo = new GSRSupitVanKappelStrategy();
							algo.setParameters(svkParams);
							GSRadContext gsr = new GSRadContext(
									(IAGSRadStrategy) algo);
							gsr.evaluate(rd);
							jLDailyGenGlobSolRad.setText(Double.toString(XQMath
									.round(rd.getGlobalSolarRadiation(), 2)));
						} else {
							GSRRichardsonStrategy algo = new GSRRichardsonStrategy();
							// to test the strategy implementation
							RadData rd = new RadData();
							RichardsonParameters rParams = new RichardsonParameters();

							// set parameters
							rParams.setNumberOfDaysInMonth(30);
							rParams.setNumberOfWetDaysInMonth(9);
							rParams.setRadiationMonthlyAverage(Double
									.parseDouble(jTFRichMR.getText()));
							rParams.setRadiationMonthlyStandardDeviation(Double
									.parseDouble(jTFRichMStdDevRad.getText()));
							rParams.setScalingFactorWetDry(0.4);
							rParams
									.setSelectedMethod(MethodEnum.Method_Separated);
							rParams.setSelectedState(StateEnum.State_Wet);
							rd.setGlobalSolarRadiationResidual(0.5);
							algo.setParameters(rParams);
							GSRadContext i = new GSRadContext(
									(IAGSRadStrategy) algo);
							i.evaluate(rd);
							jLDailyGenGlobSolRad.setText(Double.toString(XQMath
									.round(rd.getGlobalSolarRadiation(), 2)));
						}
					} catch (Throwable t) {
						t.printStackTrace();
						JOptionPane.showMessageDialog(null, t.getMessage());
					}
				}
			});
		}
		return jBDaily;
	}

	/**
	 * This method initializes jTFBCSlope
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFBCSlope() {
		if (jTFBCSlope == null) {
			jTFBCSlope = new JTextField();
			jTFBCSlope.setBounds(new java.awt.Rectangle(10, 40, 41, 21));
			jTFBCSlope.setText("1");
		}
		return jTFBCSlope;
	}

	/**
	 * This method initializes jTFBCAitTMonth
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFBCAitTMonth() {
		if (jTFBCAitTMonth == null) {
			jTFBCAitTMonth = new JTextField();
			jTFBCAitTMonth.setBounds(new java.awt.Rectangle(10, 100, 41, 21));
			jTFBCAitTMonth.setText("12");
		}
		return jTFBCAitTMonth;
	}

	/**
	 * This method initializes jTFAitTDay
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFBCAitTDay() {
		if (jTFBCAitTDay == null) {
			jTFBCAitTDay = new JTextField();
			jTFBCAitTDay.setBounds(new java.awt.Rectangle(10, 70, 41, 21));
			jTFBCAitTDay.setText("10");
		}
		return jTFBCAitTDay;
	}

	/**
	 * This method initializes jPGSR
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPGSR() {
		if (jPGSR == null) {
			jLabel20 = new JLabel();
			jLabel20.setBounds(new java.awt.Rectangle(630, 210, 101, 21));
			jLabel20.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel20.setText("(MJ m-2 d-1)");
			jLabel19 = new JLabel();
			jLabel19.setBounds(new java.awt.Rectangle(630, 190, 141, 21));
			jLabel19.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel19.setText("global solar radiation");
			jLabel18 = new JLabel();
			jLabel18.setBounds(new java.awt.Rectangle(570, 160, 201, 21));
			jLabel18.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel18.setText("input for global solar radiation hourly");
			jLabel17 = new JLabel();
			jLabel17.setBounds(new java.awt.Rectangle(630, 110, 101, 21));
			jLabel17.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel17.setText("latitude (degree)");
			jLabel16 = new JLabel();
			jLabel16.setBounds(new java.awt.Rectangle(630, 80, 41, 21));
			jLabel16.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel16.setText("day (d)");
			jLabel15 = new JLabel();
			jLabel15.setBounds(new java.awt.Rectangle(570, 40, 171, 21));
			jLabel15.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel15.setText("global solar radiation");
			jLabel14 = new JLabel();
			jLabel14.setBounds(new java.awt.Rectangle(570, 20, 171, 21));
			jLabel14.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel14.setText("input for extraterrestial");
			jPGSR = new JPanel();
			jPGSR.setLayout(null);
			jPGSR.add(jLabel14, null);
			jPGSR.add(jLabel15, null);
			jPGSR.add(getJTFGSRDay(), null);
			jPGSR.add(jLabel16, null);
			jPGSR.add(getJTFGSRLatitude(), null);
			jPGSR.add(jLabel17, null);
			jPGSR.add(jLabel18, null);
			jPGSR.add(getJTFGSRGSR(), null);
			jPGSR.add(jLabel19, null);
			jPGSR.add(jLabel20, null);
			jPGSR.add(getJButton(), null);
			jPGSR.add(getJSPGSR(), null);
		}
		return jPGSR;
	}

	/**
	 * This method initializes jTFGSRDay
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFGSRDay() {
		if (jTFGSRDay == null) {
			jTFGSRDay = new JTextField();
			jTFGSRDay.setBounds(new java.awt.Rectangle(570, 80, 41, 21));
			jTFGSRDay.setText("30");
		}
		return jTFGSRDay;
	}

	/**
	 * This method initializes jTFGSRLatitude
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFGSRLatitude() {
		if (jTFGSRLatitude == null) {
			jTFGSRLatitude = new JTextField();
			jTFGSRLatitude.setBounds(new java.awt.Rectangle(570, 110, 41, 21));
			jTFGSRLatitude.setText("45");
		}
		return jTFGSRLatitude;
	}

	/**
	 * This method initializes jTFGSRGSR
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFGSRGSR() {
		if (jTFGSRGSR == null) {
			jTFGSRGSR = new JTextField();
			jTFGSRGSR.setBounds(new java.awt.Rectangle(570, 190, 51, 21));
			jTFGSRGSR.setText("10");
		}
		return jTFGSRGSR;
	}

	/**
	 * This method initializes jButton
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJButton() {
		if (jButton == null) {
			jButton = new JButton();
			jButton.setBounds(new java.awt.Rectangle(620, 260, 111, 41));
			jButton
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jButton.setText("generate");
			jButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					// TODO GSR
					/*
					 * JPanel panel = new JPanel(true); // panel.setSize(300,
					 * 300); panel.setBounds(new java.awt.Rectangle(5, 5, 310,
					 * 310));
					 * 
					 * jPGSR.add(panel); String[] xAxisLabels = { "1998",
					 * "1999", "2000", "2001", "2002", "2003", "2004" };
					 * 
					 * String xAxisTitle = "Years";
					 * 
					 * String yAxisTitle = "Problems";
					 * 
					 * String title = "Microsoft at Work";
					 * 
					 * DataSeries dataSeries = new DataSeries(xAxisLabels,
					 * xAxisTitle, yAxisTitle, title);
					 * 
					 * double[][] data = TestDataGenerator.getRandomNumbers(1,
					 * 7, 0, 6000); // double[24][2] data ; String[]
					 * legendLabels = { "Bugs" };
					 * 
					 * Paint[] paints = TestDataGenerator.getRandomPaints(1);
					 * 
					 * Shape[] shapes = { PointChartProperties.SHAPE_CIRCLE };
					 * 
					 * boolean[] fillPointFlags = { false };
					 * 
					 * Paint[] outlinePaints = { Color.red };
					 * 
					 * PointChartProperties pointChartProperties = new
					 * PointChartProperties( shapes, fillPointFlags,
					 * outlinePaints); try { AxisChartDataSet axisChartDataSet =
					 * new AxisChartDataSet( data, legendLabels, paints,
					 * ChartType.POINT, pointChartProperties);
					 * dataSeries.addIAxisPlotDataSet(axisChartDataSet); } catch
					 * (Exception e1) { }
					 * 
					 * ChartProperties chartProperties = new ChartProperties();
					 * 
					 * AxisProperties axisProperties = new AxisProperties();
					 * 
					 * LegendProperties legendProperties = new
					 * LegendProperties();
					 * 
					 * AxisChart axisChart = new AxisChart(dataSeries,
					 * chartProperties, axisProperties, legendProperties, 300,
					 * 300); axisChart.setGraphics2D((Graphics2D)
					 * panel.getGraphics()); try { axisChart.render(); } catch
					 * (Exception e2) { }
					 */
					IRadData rd = new RadData();

					rd.setGlobalSolarRadiation(28.13);
					rd.setExtraTerrestrialRadiationHourly(0, 0);
					rd.setExtraTerrestrialRadiationHourly(0, 1);
					rd.setExtraTerrestrialRadiationHourly(0, 2);
					rd.setExtraTerrestrialRadiationHourly(0, 3);
					rd.setExtraTerrestrialRadiationHourly(0, 4);
					rd.setExtraTerrestrialRadiationHourly(0.54, 5);
					rd.setExtraTerrestrialRadiationHourly(1.36, 6);
					rd.setExtraTerrestrialRadiationHourly(2.22, 7);
					rd.setExtraTerrestrialRadiationHourly(3.1, 8);
					rd.setExtraTerrestrialRadiationHourly(3.97, 9);
					rd.setExtraTerrestrialRadiationHourly(4.78, 10);
					rd.setExtraTerrestrialRadiationHourly(5.42, 11);
					rd.setExtraTerrestrialRadiationHourly(5.69, 12);
					rd.setExtraTerrestrialRadiationHourly(5.42, 13);
					rd.setExtraTerrestrialRadiationHourly(4.78, 14);
					rd.setExtraTerrestrialRadiationHourly(3.97, 15);
					rd.setExtraTerrestrialRadiationHourly(3.1, 16);
					rd.setExtraTerrestrialRadiationHourly(2.22, 17);
					rd.setExtraTerrestrialRadiationHourly(1.36, 18);
					rd.setExtraTerrestrialRadiationHourly(0.54, 19);
					rd.setExtraTerrestrialRadiationHourly(0, 20);
					rd.setExtraTerrestrialRadiationHourly(0, 21);
					rd.setExtraTerrestrialRadiationHourly(0, 22);
					rd.setExtraTerrestrialRadiationHourly(0, 23);

					HGSRGlobalSolarRadiationHourlyStrategy algo = new HGSRGlobalSolarRadiationHourlyStrategy();
					GSRadContext gsr = new GSRadContext((IAGSRadStrategy) algo);
					gsr.evaluate(rd);
					for (int i = 0; i < TModelGSR.getRowCount(); i++) {
						TModelGSR.setValueAt(new Double(XQMath.round(rd
								.getGlobalSolarRadiationHourly(i), 2)), i, 1);
					}
				}
			});
		}
		return jButton;
	}

	/**
	 * This method initializes jTFDBC1
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFDBC1() {
		if (jTFDBC1 == null) {
			jTFDBC1 = new JTextField();
			jTFDBC1.setBounds(new java.awt.Rectangle(10, 40, 41, 21));
			jTFDBC1.setText("0.1");
		}
		return jTFDBC1;
	}

	/**
	 * This method initializes jPanel
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPBRDC() {
		if (jPBRDC == null) {
			jLabel26 = new JLabel();
			jLabel26.setBounds(new java.awt.Rectangle(680, 190, 121, 21));
			jLabel26.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel26.setText("current day");
			jLabel24 = new JLabel();
			jLabel24.setBounds(new java.awt.Rectangle(680, 160, 131, 21));
			jLabel24.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel24.setText("clear sky transmissivity");
			jLabel23 = new JLabel();
			jLabel23.setBounds(new java.awt.Rectangle(680, 130, 131, 21));
			jLabel23.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel23.setText("linked turbidity factor");
			jLabel22 = new JLabel();
			jLabel22.setBounds(new java.awt.Rectangle(680, 100, 91, 21));
			jLabel22.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel22.setText("albedo");
			jLabel21 = new JLabel();
			jLabel21.setBounds(new java.awt.Rectangle(680, 70, 91, 21));
			jLabel21.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
					12));
			jLabel21.setText("elevation (m)");
			jLabel9 = new JLabel();
			jLabel9.setBounds(new java.awt.Rectangle(610, 20, 141, 21));
			jLabel9
					.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN,
							12));
			jLabel9.setText("model Liu and Jordan");
			jPBRDC = new JPanel();
			jPBRDC.setLayout(null);
			jPBRDC.add(jLabel9, null);
			jPBRDC.add(getJTFElevation(), null);
			jPBRDC.add(jLabel21, null);
			jPBRDC.add(getJTFAlbedo(), null);
			jPBRDC.add(jLabel22, null);
			jPBRDC.add(getJTFLTF(), null);
			jPBRDC.add(jLabel23, null);
			jPBRDC.add(getJBLiu(), null);
			jPBRDC.add(getJSPBRDC(), null);
			jPBRDC.add(getJTFClearSkyTransLJ(), null);
			jPBRDC.add(jLabel24, null);
			jPBRDC.add(getJTFDay(), null);
			jPBRDC.add(jLabel26, null);
		}
		return jPBRDC;
	}

	/**
	 * This method initializes jTFElevation
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFElevation() {
		if (jTFElevation == null) {
			jTFElevation = new JTextField();
			jTFElevation.setBounds(new java.awt.Rectangle(610, 70, 51, 21));
			jTFElevation.setText("0");
		}
		return jTFElevation;
	}

	/**
	 * This method initializes jTFAlbedo
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFAlbedo() {
		if (jTFAlbedo == null) {
			jTFAlbedo = new JTextField();
			jTFAlbedo.setBounds(new java.awt.Rectangle(610, 100, 51, 21));
			jTFAlbedo.setText("0.2");
		}
		return jTFAlbedo;
	}

	/**
	 * This method initializes jTFLTF
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFLTF() {
		if (jTFLTF == null) {
			jTFLTF = new JTextField();
			jTFLTF.setBounds(new java.awt.Rectangle(610, 130, 51, 21));
			jTFLTF.setText("3");
		}
		return jTFLTF;
	}

	/**
	 * This method initializes jBLiu
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJBLiu() {
		if (jBLiu == null) {
			jBLiu = new JButton();
			jBLiu.setBounds(new java.awt.Rectangle(660, 310, 101, 41));
			jBLiu.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12));
			jBLiu.setText("generate");
			jBLiu.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					// TODO BRDC
					IRadData rd = new RadData();
					LiuJordanHourlyParameters ljhParams = new LiuJordanHourlyParameters();

					ljhParams.setHourlyLinkedTurbidityFactor(Double
							.parseDouble(jTFLTF.getText()));

					rd.setAlbedo(Double.parseDouble(jTFAlbedo.getText()));
					rd.setElevation(Double.parseDouble(jTFElevation.getText()),
							1, 1);
					rd.setAngleSlope(0);
					rd.setClearSkyTransmissivity((Double
							.parseDouble(jTFClearSkyTransLJ.getText())));
					rd.setCurrentDay(Integer.parseInt(jTFDay.getText()));
					rd.setHourSunrise(5);
					rd.setHourSunset(19);

					rd.setGlobalSolarRadiationHourly(0, 0);
					rd.setGlobalSolarRadiationHourly(0, 1);
					rd.setGlobalSolarRadiationHourly(0, 2);
					rd.setGlobalSolarRadiationHourly(0, 3);
					rd.setGlobalSolarRadiationHourly(0, 4);
					rd.setGlobalSolarRadiationHourly(0.36, 5);
					rd.setGlobalSolarRadiationHourly(0.9, 6);
					rd.setGlobalSolarRadiationHourly(1.43, 7);
					rd.setGlobalSolarRadiationHourly(1.93, 8);
					rd.setGlobalSolarRadiationHourly(2.36, 9);
					rd.setGlobalSolarRadiationHourly(2.69, 10);
					rd.setGlobalSolarRadiationHourly(2.89, 11);
					rd.setGlobalSolarRadiationHourly(2.97, 12);
					rd.setGlobalSolarRadiationHourly(2.9, 13);
					rd.setGlobalSolarRadiationHourly(2.69, 14);
					rd.setGlobalSolarRadiationHourly(2.36, 15);
					rd.setGlobalSolarRadiationHourly(1.93, 16);
					rd.setGlobalSolarRadiationHourly(1.43, 17);
					rd.setGlobalSolarRadiationHourly(0.9, 18);
					rd.setGlobalSolarRadiationHourly(0.36, 19);
					rd.setGlobalSolarRadiationHourly(0, 20);
					rd.setGlobalSolarRadiationHourly(0, 21);
					rd.setGlobalSolarRadiationHourly(0, 22);
					rd.setGlobalSolarRadiationHourly(0, 23);

					rd.setSolarElevation(0, 0);
					rd.setSolarElevation(0, 1);
					rd.setSolarElevation(0, 2);
					rd.setSolarElevation(0, 3);
					rd.setSolarElevation(0, 4);
					rd.setSolarElevation(0.114, 5);
					rd.setSolarElevation(0.285, 6);
					rd.setSolarElevation(0.466, 7);
					rd.setSolarElevation(0.651, 8);
					rd.setSolarElevation(0.833, 9);
					rd.setSolarElevation(1.003, 10);
					rd.setSolarElevation(1.138, 11);
					rd.setSolarElevation(1.195, 12);
					rd.setSolarElevation(1.138, 13);
					rd.setSolarElevation(1.003, 14);
					rd.setSolarElevation(0.833, 15);
					rd.setSolarElevation(0.651, 16);
					rd.setSolarElevation(0.466, 17);
					rd.setSolarElevation(0.285, 18);
					rd.setSolarElevation(0.114, 19);
					rd.setSolarElevation(0, 20);
					rd.setSolarElevation(0, 21);
					rd.setSolarElevation(0, 22);
					rd.setSolarElevation(0, 23);

					rd.setSlopeAspectFactorHourly(0, 0);
					rd.setSlopeAspectFactorHourly(0, 1);
					rd.setSlopeAspectFactorHourly(0, 2);
					rd.setSlopeAspectFactorHourly(0, 3);
					rd.setSlopeAspectFactorHourly(0, 4);
					rd.setSlopeAspectFactorHourly(1, 5);
					rd.setSlopeAspectFactorHourly(1, 5);
					rd.setSlopeAspectFactorHourly(1, 6);
					rd.setSlopeAspectFactorHourly(1, 7);
					rd.setSlopeAspectFactorHourly(1, 8);
					rd.setSlopeAspectFactorHourly(1, 9);
					rd.setSlopeAspectFactorHourly(1, 10);
					rd.setSlopeAspectFactorHourly(1, 11);
					rd.setSlopeAspectFactorHourly(1, 12);
					rd.setSlopeAspectFactorHourly(1, 13);
					rd.setSlopeAspectFactorHourly(1, 14);
					rd.setSlopeAspectFactorHourly(1, 15);
					rd.setSlopeAspectFactorHourly(1, 16);
					rd.setSlopeAspectFactorHourly(1, 17);
					rd.setSlopeAspectFactorHourly(1, 18);
					rd.setSlopeAspectFactorHourly(1, 19);
					rd.setSlopeAspectFactorHourly(0, 20);
					rd.setSlopeAspectFactorHourly(0, 21);
					rd.setSlopeAspectFactorHourly(0, 22);
					rd.setSlopeAspectFactorHourly(0, 23);

					HBDRLiuJordanHourlyStrategy algo = new HBDRLiuJordanHourlyStrategy();
					algo.setParameters(ljhParams);

					GSRadContext gsr = new GSRadContext((IAGSRadStrategy) algo);
					gsr.evaluate(rd);
					for (int i = 0; i < ModelBRDC.getRowCount(); i++) {
						ModelBRDC.setValueAt(new Double(XQMath.round(rd
								.getHourlyRadiationBeam(i), 3)), i, 1);
						ModelBRDC.setValueAt(new Double(XQMath.round(rd
								.getHourlyRadiationDiffuseSky(i), 2)), i, 2);
						ModelBRDC.setValueAt(new Double(XQMath.round(rd
								.getHourlyRadiationReflectedSoil(i), 2)), i, 3);
					}
				}
			});
		}
		return jBLiu;
	}

	/**
	 * This method initializes jSPGSR
	 * 
	 * @return javax.swing.JScrollPane
	 */
	private JScrollPane getJSPGSR() {
		if (jSPGSR == null) {
			jSPGSR = new JScrollPane();
			jSPGSR.setBounds(new java.awt.Rectangle(410, 10, 151, 351));
			jSPGSR.setViewportView(getJTGSR());
		}
		return jSPGSR;
	}

	/**
	 * This method initializes jTGSR
	 * 
	 * @return javax.swing.JTable
	 */
	private JTable getJTGSR() {
		if (jTGSR == null) {
			jTGSR = new JTable();
			jTGSR.setModel(getTModelGSR());
		}
		return jTGSR;
	}

	/**
	 * This method initializes TModelGSR
	 * 
	 * @return javax.swing.table.DefaultTableModel
	 */
	private DefaultTableModel getTModelGSR() {
		if (TModelGSR == null) {
			TModelGSR = new DefaultTableModel();
			TModelGSR.setColumnCount(2);
			TModelGSR.setRowCount(24);
			TModelGSR.setColumnIdentifiers(new String[] { "hour", "GSR" });
			for (int i = 0; i < TModelGSR.getRowCount(); i++) {
				TModelGSR.setValueAt(new Integer(i), i, 0);
			}
		}
		return TModelGSR;
	}

	/**
	 * This method initializes jSPBRDC
	 * 
	 * @return javax.swing.JScrollPane
	 */
	private JScrollPane getJSPBRDC() {
		if (jSPBRDC == null) {
			jSPBRDC = new JScrollPane();
			jSPBRDC.setBounds(new java.awt.Rectangle(360, 10, 241, 351));
			jSPBRDC.setViewportView(getJTBRDC());
		}
		return jSPBRDC;
	}

	/**
	 * This method initializes jTBRDC
	 * 
	 * @return javax.swing.JTable
	 */
	private JTable getJTBRDC() {
		if (jTBRDC == null) {
			jTBRDC = new JTable();
			jTBRDC.setModel(getModelBRDC());
			jTBRDC.getColumnModel().getColumn(0).setMaxWidth(35);
			jTBRDC.getColumnModel().getColumn(0).setPreferredWidth(35);
			jTBRDC.getColumnModel().getColumn(1).setMaxWidth(40);
			jTBRDC.getColumnModel().getColumn(1).setPreferredWidth(40);
			jTBRDC.getColumnModel().getColumn(2).setMaxWidth(70);
			jTBRDC.getColumnModel().getColumn(2).setPreferredWidth(70);
			jTBRDC.getColumnModel().getColumn(3).setMaxWidth(80);
			jTBRDC.getColumnModel().getColumn(3).setPreferredWidth(80);
		}
		return jTBRDC;
	}

	/**
	 * This method initializes ModelBRDC
	 * 
	 * @return javax.swing.table.DefaultTableModel
	 */
	private DefaultTableModel getModelBRDC() {
		if (ModelBRDC == null) {
			ModelBRDC = new DefaultTableModel();
			ModelBRDC.setColumnCount(4);
			ModelBRDC.setRowCount(24);
			ModelBRDC.setColumnIdentifiers(new String[] { "hour", "Beam",
					"Diffuse Sky", "Reflected Soil" });
			for (int i = 0; i < ModelBRDC.getRowCount(); i++) {
				ModelBRDC.setValueAt(new Integer(i), i, 0);
			}
		}
		return ModelBRDC;
	}

	/**
	 * This method initializes jTFClearSkyTransLJ
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFClearSkyTransLJ() {
		if (jTFClearSkyTransLJ == null) {
			jTFClearSkyTransLJ = new JTextField();
			jTFClearSkyTransLJ.setBounds(new java.awt.Rectangle(610, 160, 51,
					21));
			jTFClearSkyTransLJ.setText("0.75");
		}
		return jTFClearSkyTransLJ;
	}

	/**
	 * This method initializes jTFDay
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTFDay() {
		if (jTFDay == null) {
			jTFDay = new JTextField();
			jTFDay.setBounds(new java.awt.Rectangle(610, 190, 51, 21));
			jTFDay.setText("172");
		}
		return jTFDay;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		FrontEnd client = new FrontEnd();

	}

	/**
	 * This is the default constructor
	 */
	public FrontEnd() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(831, 431);
		this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
		this.setContentPane(getJContentPane());
		this.setTitle("GSRAD Java Client");
		this.setVisible(true);
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
			jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
		}
		return jContentPane;
	}

} // @jve:decl-index=0:visual-constraint="2,5"
